
import { builders, httpClient } from '../request'
import * as api from '../api'

// 查询
export function get{{vm.startCaseName}} (params) {
  const request = builders.getBuilder.build()
  request.setUrl(api.get{{vm.startCaseName}}).setData(params)
  return httpClient.execute(request)
}

// 保存/编辑
// post 请求体
export function add{{vm.startCaseName}} (params) {
  const request = builders.postBuilder.build()
  request.setUrl(api.add{{vm.startCaseName}}).setData(params)
  return httpClient.execute(request)
}

// 保存/编辑
// post form data
export function edit{{vm.startCaseName}} (params) {
  const request = builders.postFormBuilder.build()
  request.setUrl(api.edit{{vm.startCaseName}}).setData(params)
  return httpClient.execute(request)
}

// 删除
// post 请求体
export function delete{{vm.startCaseName}} (params) {
  const request = builders.postBuilder.build()
  request.setUrl(api.delete{{vm.startCaseName}}).setData(params)
  return httpClient.execute(request)
}

// 粘贴的内容

// api.js
// export const get{{vm.startCaseName}} = '/get{{vm.startCaseName}}'
// export const add{{vm.startCaseName}} = '/add{{vm.startCaseName}}'
// export const edit{{vm.startCaseName}} = '/edit{{vm.startCaseName}}'
// export const delete{{vm.startCaseName}} = '/delete{{vm.startCaseName}}'

// action/index.js
// import { get{{vm.startCaseName}}, add{{vm.startCaseName}}, edit{{vm.startCaseName}}, delete{{vm.startCaseName}}  } from 'SRC/service/{{vm.startCaseName}}'
